/**
 * There are <a href="https://github.com/thinkgem/jeesite">JeeSite</a> code generation
 */
package com.chlitina.store.modules.expert.entity;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import com.chlitina.store.common.persistence.BaseEntity;
import com.google.common.collect.Lists;

/**
 * 系统护理Entity
 * @author liujiang
 * @version 2013-11-02
 */
@Entity
@Table(name = "care")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Care extends BaseEntity {
	public static final int TYPE_FACE = 0;//面部护理
	public static final int TYPE_BODY = 1;//身体护理 
	public static final int TYPE_DEVICE = 2;//仪器护理
	
	private static final long serialVersionUID = 1L;
	private Long id; 		// 护理方案编号
	private String name; 	// 护理名称
	private int duration;	// 本护理所需时长
	private String description;	// 描述
	private float price; //护理标准指导价
	private int times;	// 护理次数（从1开始的正整数，100之内）
	private int type;	// 护理类型：0：面部护理1：身体护理 2：仪器护理
	private int status; //状态信息 0 - 可用 1 - 不可用
	
	private List<CareStoreType> storeTypeList = Lists.newArrayList();
	
	public Care() {
	}

	public Care(Long id){
		this();
		this.id = id;
	}
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getDuration() {
		return duration;
	}

	public void setDuration(int duration) {
		this.duration = duration;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public float getPrice() {
		return price;
	}

	public void setPrice(float price) {
		this.price = price;
	}

	public int getTimes() {
		return times;
	}

	public void setTimes(int times) {
		this.times = times;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}
	
	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}
	
	@OneToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY,mappedBy="care")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	public List<CareStoreType> getStoreTypeList() {
		return storeTypeList;
	}

	public void setStoreTypeList(List<CareStoreType> storeTypeList) {
		this.storeTypeList = storeTypeList;
	}
}


